import Cookies from 'js-cookie'

const TokenKey = 'hr-token' // 储存token的key值
const timeKey = 'hr-time' // 设置时间戳

// 获取token
export function getToken() {
  return Cookies.get(TokenKey)
}
// 设置token
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
// 删除token
export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 读取时间戳
export function getTimeStamp() {
  return Cookies.get(timeKey)
}
// 设置时间戳
export function setTimeStamp() {
  // 当前时间
  Cookies.set(timeKey, new Date().getTime())
}
